package com.ifgostudio.bocai.system.entity;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import com.ifgostudio.framework.entry.BaseEntity;


@Entity
@Table(name = "role_permission")
public class RolePermission extends BaseEntity{

	/**
	 * 
	 */
	private static final long serialVersionUID = -191361063345231344L;
	
	/**
	 * 角色
	 */
	@ManyToOne(cascade={CascadeType.ALL},optional=true)
	@JoinColumn(name = "role_id")
	private Role role;
	
	/**
	 * 权限
	 */
	@ManyToOne(cascade={CascadeType.ALL},optional=true)
	@JoinColumn(name = "permission_id")
	private Permission permission;

	/**
	 * 获取角色
	 * @return role 角色
	 */
	public Role getRole() {
		return role;
	}

	/**
	 * 设置角色
	 * @param role 角色
	 */
	public void setRole(Role role) {
		this.role = role;
	}

	/**
	 * 获取权限
	 * @return permission 权限
	 */
	public Permission getPermission() {
		return permission;
	}

	/**
	 * 设置权限
	 * @param permission 权限
	 */
	public void setPermission(Permission permission) {
		this.permission = permission;
	}

}
